<template>
  <el-dialog
    title="修改预估工时/剩余工时"
    :visible.sync="dialogVisible"
    width="530px"
    :close-on-click-modal="false"
    :before-close="handleClose">
    <div class="content">
      <el-form :model="ruleForm" ref="ruleForm" label-width="110px" class="demo-ruleForm">
        <el-form-item label="预估工时(h)" prop="cEstWork">
          <el-input-number class="inputNumber" v-model="ruleForm.cEstWork" :controls="false" placeholder="未设置"></el-input-number>
        </el-form-item>
        <el-form-item label="剩余工时(h)" prop="cRegWork">
          <el-input-number class="inputNumber" v-model="ruleForm.cRemWork" :controls="false" placeholder="未设置"></el-input-number>
        </el-form-item>
      </el-form>
    </div>
    <span slot="footer" class="dialog-footer">
      <el-button @click="handleClose">取 消</el-button>
      <el-button type="primary" @click="done">完成</el-button>
    </span>
  </el-dialog>
</template>

<script>
export default {
  name: "editWorkTime",
  data() {
    return {
      dialogVisible: false,
      ruleForm: {}
    }
  },
  methods: {
    open(row) {
      this.ruleForm = row
      this.dialogVisible = true
    },
    handleClose() {
      this.ruleForm = {}
      this.dialogVisible = false
    },
    done() {
      this.$emit('emitWork', this.ruleForm)
      this.handleClose()
    }
  }
}
</script>

<style lang="scss" scoped>
.content {
  padding: 20px;
}
.inputNumber {
  width: 300px;
}
</style>
